package com.ybxx.config.service.impl;

import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.ybxx.config.dao.HousingPropertyDao;
import com.ybxx.config.model.HouseType;
import com.ybxx.config.model.HousingProperty;
import com.ybxx.config.service.HousingPropertyService;
import com.ybxx.core.command.QueryFilter;
import com.ybxx.core.dao.GenericDao;
import com.ybxx.core.service.impl.BaseServiceImpl;
import com.ybxx.core.web.paging.PagingBean;

public class HousingPropertyServiceImpl extends
		BaseServiceImpl<HousingProperty> implements HousingPropertyService {
	private HousingPropertyDao housingPropertyDao;
	public HousingPropertyServiceImpl(HousingPropertyDao dao) {
		super(dao);
		this.housingPropertyDao=dao;
		// TODO Auto-generated constructor stub
	}
	public List<HousingProperty> queryPage(HousingProperty housingProperty,QueryFilter filter) {
		String hql="from HousingProperty hp";
		String condition=" where ";
		if(housingProperty!=null && StringUtils.isNotEmpty(housingProperty.getHpname())){
			hql+=condition+" hp.hpname='"+housingProperty.getHpname()+"' ";
		}
		return housingPropertyDao.findByHql(hql, null,filter.getPagingBean());
	}

}
